﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading.Tasks;

namespace WebScraperLibrary
{
    public class WebScraper
    {
            //TODO: Build a proper WebRequest with a proper header tags.
            //i.e. getWebRequest();
            public string GetDataFromUrl(string url) {
                WebRequest request = WebRequest.Create(url);
                WebResponse response = request.GetResponse();
                Stream dataStream = response.GetResponseStream();
                StreamReader reader = new StreamReader (dataStream, Encoding.Default, true);
                string responseFromServer = reader.ReadToEnd();
                reader.Close();
                response.Close();
		
	            return responseFromServer;
            }

    }

}
